<!-- HTML header for doxygen 1.9.6-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.6"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>COMMONS-NET: commonsNet.echo.EchoUDPClient类 参考</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
  $(document).ready(function() { init_search(); });
/* @license-end */
</script>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">COMMONS-NET
   </div>
  </td>
    <td>        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <span id="MSearchSelect"                onmouseover="return searchBox.OnSearchSelectShow()"                onmouseout="return searchBox.OnSearchSelectHide()">&#160;</span>
          <input type="text" id="MSearchField" value="" placeholder="搜索" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.svg" alt=""/></a>
          </span>
        </div>
</td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.9.6 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('classcommonsNet_1_1echo_1_1EchoUDPClient.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">载入中...</div>
<div class="SRStatus" id="Searching">搜索中...</div>
<div class="SRStatus" id="NoMatches">未找到</div>
</div>
</div>
</div>
</div>

<div class="header">
  <div class="summary">
<a href="#pub-methods">Public 成员函数</a> &#124;
<a href="#pub-attribs">Public 属性</a> &#124;
<a href="#pri-attribs">Private 属性</a> &#124;
<a href="classcommonsNet_1_1echo_1_1EchoUDPClient-members.html">所有成员列表</a>  </div>
  <div class="headertitle"><div class="title">commonsNet.echo.EchoUDPClient类 参考</div></div>
</div><!--header-->
<div class="contents">

<p>EchoUDPClient 类是实现了 RFC 862 中描述的 Echo 协议的 UDP 客户端。  
 <a href="classcommonsNet_1_1echo_1_1EchoUDPClient.html#details">更多...</a></p>
<div class="dynheader">
类 commonsNet.echo.EchoUDPClient 继承关系图:</div>
<div class="dyncontent">
 <div class="center">
  <img src="classcommonsNet_1_1echo_1_1EchoUDPClient.png" usemap="#commonsNet.echo.EchoUDPClient_map" alt=""/>
  <map id="commonsNet.echo.EchoUDPClient_map" name="commonsNet.echo.EchoUDPClient_map">
<area href="classcommonsNet_1_1discard_1_1DiscardUDPClient.html" title="DiscardUDPClient 类是实现了 RFC 863 中描述的 Discard 协议的 UDP 客户端。" alt="commonsNet.discard.DiscardUDPClient" shape="rect" coords="0,56,234,80"/>
<area href="classcommonsNet_1_1DatagramSocketClient.html" alt="commonsNet.DatagramSocketClient" shape="rect" coords="0,0,234,24"/>
  </map>
</div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
Public 成员函数</h2></td></tr>
<tr class="memitem:a45cd29f0b30fb5ad15bce2b2442958bc"><td class="memItemLeft" align="right" valign="top">public func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1echo_1_1EchoUDPClient.html#a45cd29f0b30fb5ad15bce2b2442958bc">receive</a> (data: Array&lt;Byte&gt;): Int64</td></tr>
<tr class="memdesc:a45cd29f0b30fb5ad15bce2b2442958bc"><td class="mdescLeft">&#160;</td><td class="mdescRight">与 receive(data, data.length) 相同。  <br /></td></tr>
<tr class="separator:a45cd29f0b30fb5ad15bce2b2442958bc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac0739c978df8216acc6c4b6f782dfab0"><td class="memItemLeft" align="right" valign="top">public func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1echo_1_1EchoUDPClient.html#ac0739c978df8216acc6c4b6f782dfab0">receive</a> (data: Array&lt;Byte&gt;, length: Int64): Int64</td></tr>
<tr class="memdesc:ac0739c978df8216acc6c4b6f782dfab0"><td class="mdescLeft">&#160;</td><td class="mdescRight">接收回显数据并返回其长度。  <br /></td></tr>
<tr class="separator:ac0739c978df8216acc6c4b6f782dfab0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0f81c305c2b1bbf0eace72548b1df334"><td class="memItemLeft" align="right" valign="top">public func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1echo_1_1EchoUDPClient.html#a0f81c305c2b1bbf0eace72548b1df334">echosend</a> (data: Array&lt;Byte&gt;, host: String): Unit</td></tr>
<tr class="memdesc:a0f81c305c2b1bbf0eace72548b1df334"><td class="mdescLeft">&#160;</td><td class="mdescRight">与 send(data, data.length, host) 相同。  <br /></td></tr>
<tr class="separator:a0f81c305c2b1bbf0eace72548b1df334"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9ca41f3b665d12f63c94d7ef960a94f7"><td class="memItemLeft" align="right" valign="top">public func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1echo_1_1EchoUDPClient.html#a9ca41f3b665d12f63c94d7ef960a94f7">echosend</a> (data: Array&lt;Byte&gt;, length: Int64, host: String): Unit</td></tr>
<tr class="memdesc:a9ca41f3b665d12f63c94d7ef960a94f7"><td class="mdescLeft">&#160;</td><td class="mdescRight">将指定的数据发送到指定服务器的默认 echo 端口。  <br /></td></tr>
<tr class="separator:a9ca41f3b665d12f63c94d7ef960a94f7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a70f445f7c6b3a623e03ebd61aaaf6b89"><td class="memItemLeft" align="right" valign="top">public func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1echo_1_1EchoUDPClient.html#a70f445f7c6b3a623e03ebd61aaaf6b89">getreceivedata</a> (): Array&lt;UInt8&gt;</td></tr>
<tr class="memdesc:a70f445f7c6b3a623e03ebd61aaaf6b89"><td class="mdescLeft">&#160;</td><td class="mdescRight">获取接收到的数据。  <br /></td></tr>
<tr class="separator:a70f445f7c6b3a623e03ebd61aaaf6b89"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_methods_classcommonsNet_1_1discard_1_1DiscardUDPClient"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_classcommonsNet_1_1discard_1_1DiscardUDPClient')"><img src="closed.png" alt="-"/>&#160;Public 成员函数 继承自 <a class="el" href="classcommonsNet_1_1discard_1_1DiscardUDPClient.html">commonsNet.discard.DiscardUDPClient</a></td></tr>
<tr class="memitem:a6718e33a90ccc07348c7a3e9fbf1a5e2 inherit pub_methods_classcommonsNet_1_1discard_1_1DiscardUDPClient"><td class="memItemLeft" align="right" valign="top">public func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1discard_1_1DiscardUDPClient.html#a6718e33a90ccc07348c7a3e9fbf1a5e2">send</a> (data: Array&lt;Byte&gt;, host: String): Unit</td></tr>
<tr class="memdesc:a6718e33a90ccc07348c7a3e9fbf1a5e2 inherit pub_methods_classcommonsNet_1_1discard_1_1DiscardUDPClient"><td class="mdescLeft">&#160;</td><td class="mdescRight">创建一个默认的 DiscardUDPClient 对象，将存储发出数据的数组初始化为空。  <br /></td></tr>
<tr class="separator:a6718e33a90ccc07348c7a3e9fbf1a5e2 inherit pub_methods_classcommonsNet_1_1discard_1_1DiscardUDPClient"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1e8d9b058832cb13f755e2154f75f100 inherit pub_methods_classcommonsNet_1_1discard_1_1DiscardUDPClient"><td class="memItemLeft" align="right" valign="top">public func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1discard_1_1DiscardUDPClient.html#a1e8d9b058832cb13f755e2154f75f100">send</a> (data: Array&lt;Byte&gt;, length: Int64, host: String): Unit</td></tr>
<tr class="memdesc:a1e8d9b058832cb13f755e2154f75f100 inherit pub_methods_classcommonsNet_1_1discard_1_1DiscardUDPClient"><td class="mdescLeft">&#160;</td><td class="mdescRight">与 send(data, length, host, DiscardUDPClient.DISCARD_DEFAULT_PORT) 相同。  <br /></td></tr>
<tr class="separator:a1e8d9b058832cb13f755e2154f75f100 inherit pub_methods_classcommonsNet_1_1discard_1_1DiscardUDPClient"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a335b89ce7abb4f595e9257455d478a08 inherit pub_methods_classcommonsNet_1_1discard_1_1DiscardUDPClient"><td class="memItemLeft" align="right" valign="top">public func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1discard_1_1DiscardUDPClient.html#a335b89ce7abb4f595e9257455d478a08">send</a> (data: Array&lt;Byte&gt;, length: Int64, host: String, port: UInt16): Unit</td></tr>
<tr class="memdesc:a335b89ce7abb4f595e9257455d478a08 inherit pub_methods_classcommonsNet_1_1discard_1_1DiscardUDPClient"><td class="mdescLeft">&#160;</td><td class="mdescRight">将指定的数据发送到指定服务器的指定端口。  <br /></td></tr>
<tr class="separator:a335b89ce7abb4f595e9257455d478a08 inherit pub_methods_classcommonsNet_1_1discard_1_1DiscardUDPClient"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_methods_classcommonsNet_1_1DatagramSocketClient"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_classcommonsNet_1_1DatagramSocketClient')"><img src="closed.png" alt="-"/>&#160;Public 成员函数 继承自 <a class="el" href="classcommonsNet_1_1DatagramSocketClient.html">commonsNet.DatagramSocketClient</a></td></tr>
<tr class="memitem:a9bebd92e7988ee9c12dbcf538f236868 inherit pub_methods_classcommonsNet_1_1DatagramSocketClient"><td class="memItemLeft" align="right" valign="top">public&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1DatagramSocketClient.html#a9bebd92e7988ee9c12dbcf538f236868">init</a> ()</td></tr>
<tr class="memdesc:a9bebd92e7988ee9c12dbcf538f236868 inherit pub_methods_classcommonsNet_1_1DatagramSocketClient"><td class="mdescLeft">&#160;</td><td class="mdescRight">无参构造函数 <em>socket</em>=None; <em>timeout</em>=0; <em>isOpen</em>=false; <em>socketFactory</em>= DEFAULT_SOCKET_FACTORY;  <br /></td></tr>
<tr class="separator:a9bebd92e7988ee9c12dbcf538f236868 inherit pub_methods_classcommonsNet_1_1DatagramSocketClient"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0a94deac969cd5a4cea9634d9195d658 inherit pub_methods_classcommonsNet_1_1DatagramSocketClient"><td class="memItemLeft" align="right" valign="top">public mut prop&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1DatagramSocketClient.html#a0a94deac969cd5a4cea9634d9195d658">receiveTimeout</a> : ?Duration</td></tr>
<tr class="memdesc:a0a94deac969cd5a4cea9634d9195d658 inherit pub_methods_classcommonsNet_1_1DatagramSocketClient"><td class="mdescLeft">&#160;</td><td class="mdescRight">属性readTimeout，用于设置和获取readTimeout  <br /></td></tr>
<tr class="separator:a0a94deac969cd5a4cea9634d9195d658 inherit pub_methods_classcommonsNet_1_1DatagramSocketClient"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac91a43c12fc616a881e49a3764364f2d inherit pub_methods_classcommonsNet_1_1DatagramSocketClient"><td class="memItemLeft" align="right" valign="top">public mut prop&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1DatagramSocketClient.html#ac91a43c12fc616a881e49a3764364f2d">sendTimeout</a> : ?Duration</td></tr>
<tr class="memdesc:ac91a43c12fc616a881e49a3764364f2d inherit pub_methods_classcommonsNet_1_1DatagramSocketClient"><td class="mdescLeft">&#160;</td><td class="mdescRight">属性sendTimeout，用于设置和获取sendTimeout  <br /></td></tr>
<tr class="separator:ac91a43c12fc616a881e49a3764364f2d inherit pub_methods_classcommonsNet_1_1DatagramSocketClient"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a95f9d80f21489bb3eb1c251d30b8aeaf inherit pub_methods_classcommonsNet_1_1DatagramSocketClient"><td class="memItemLeft" align="right" valign="top">public func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1DatagramSocketClient.html#a95f9d80f21489bb3eb1c251d30b8aeaf">close</a> ()</td></tr>
<tr class="memdesc:a95f9d80f21489bb3eb1c251d30b8aeaf inherit pub_methods_classcommonsNet_1_1DatagramSocketClient"><td class="mdescLeft">&#160;</td><td class="mdescRight">用于关闭套接字  <br /></td></tr>
<tr class="separator:a95f9d80f21489bb3eb1c251d30b8aeaf inherit pub_methods_classcommonsNet_1_1DatagramSocketClient"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8568072f87aa0cc170d01eeea0d4274b inherit pub_methods_classcommonsNet_1_1DatagramSocketClient"><td class="memItemLeft" align="right" valign="top">public func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1DatagramSocketClient.html#a8568072f87aa0cc170d01eeea0d4274b">getDefaultTimeout</a> (): Int64</td></tr>
<tr class="memdesc:a8568072f87aa0cc170d01eeea0d4274b inherit pub_methods_classcommonsNet_1_1DatagramSocketClient"><td class="mdescLeft">&#160;</td><td class="mdescRight">获取打开套接字时使用的默认超时（以毫秒为单位）  <br /></td></tr>
<tr class="separator:a8568072f87aa0cc170d01eeea0d4274b inherit pub_methods_classcommonsNet_1_1DatagramSocketClient"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aafdf43214202f97695ffe50f8e77c3f6 inherit pub_methods_classcommonsNet_1_1DatagramSocketClient"><td class="memItemLeft" align="right" valign="top">public func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1DatagramSocketClient.html#aafdf43214202f97695ffe50f8e77c3f6">getLocalAddress</a> (): Array&lt;UInt8&gt;</td></tr>
<tr class="memdesc:aafdf43214202f97695ffe50f8e77c3f6 inherit pub_methods_classcommonsNet_1_1DatagramSocketClient"><td class="mdescLeft">&#160;</td><td class="mdescRight">获取客户端的套接字绑定到的本地地址。  <br /></td></tr>
<tr class="separator:aafdf43214202f97695ffe50f8e77c3f6 inherit pub_methods_classcommonsNet_1_1DatagramSocketClient"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aec74781fb202de91341c1151836dce88 inherit pub_methods_classcommonsNet_1_1DatagramSocketClient"><td class="memItemLeft" align="right" valign="top">public func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1DatagramSocketClient.html#aec74781fb202de91341c1151836dce88">getLocalPort</a> (): UInt16</td></tr>
<tr class="memdesc:aec74781fb202de91341c1151836dce88 inherit pub_methods_classcommonsNet_1_1DatagramSocketClient"><td class="mdescLeft">&#160;</td><td class="mdescRight">获取本地主机上打开的用于连接的套接字的端口号。  <br /></td></tr>
<tr class="separator:aec74781fb202de91341c1151836dce88 inherit pub_methods_classcommonsNet_1_1DatagramSocketClient"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a537cb7e36f353ef171bc5477cf12d14c inherit pub_methods_classcommonsNet_1_1DatagramSocketClient"><td class="memItemLeft" align="right" valign="top">public func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1DatagramSocketClient.html#a537cb7e36f353ef171bc5477cf12d14c">isOpen</a> (): Bool</td></tr>
<tr class="memdesc:a537cb7e36f353ef171bc5477cf12d14c inherit pub_methods_classcommonsNet_1_1DatagramSocketClient"><td class="mdescLeft">&#160;</td><td class="mdescRight">如果客户端具有当前打开的套接字，则为 true。  <br /></td></tr>
<tr class="separator:a537cb7e36f353ef171bc5477cf12d14c inherit pub_methods_classcommonsNet_1_1DatagramSocketClient"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac49b33247f17bf47dd062d1e68d7cb24 inherit pub_methods_classcommonsNet_1_1DatagramSocketClient"><td class="memItemLeft" align="right" valign="top">public func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1DatagramSocketClient.html#ac49b33247f17bf47dd062d1e68d7cb24">open</a> ()</td></tr>
<tr class="memdesc:ac49b33247f17bf47dd062d1e68d7cb24 inherit pub_methods_classcommonsNet_1_1DatagramSocketClient"><td class="mdescLeft">&#160;</td><td class="mdescRight">在本地主机上的第一个可用端口处打开 DatagramSocket。  <br /></td></tr>
<tr class="separator:ac49b33247f17bf47dd062d1e68d7cb24 inherit pub_methods_classcommonsNet_1_1DatagramSocketClient"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acfe0264b2b558712ef0605bbe6e6d805 inherit pub_methods_classcommonsNet_1_1DatagramSocketClient"><td class="memItemLeft" align="right" valign="top">public func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1DatagramSocketClient.html#acfe0264b2b558712ef0605bbe6e6d805">open</a> (port: UInt16)</td></tr>
<tr class="memdesc:acfe0264b2b558712ef0605bbe6e6d805 inherit pub_methods_classcommonsNet_1_1DatagramSocketClient"><td class="mdescLeft">&#160;</td><td class="mdescRight">在本地主机上的指定端口处打开 DatagramSocket  <br /></td></tr>
<tr class="separator:acfe0264b2b558712ef0605bbe6e6d805 inherit pub_methods_classcommonsNet_1_1DatagramSocketClient"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afc3da28ec94b12365a60e0a8e0273409 inherit pub_methods_classcommonsNet_1_1DatagramSocketClient"><td class="memItemLeft" align="right" valign="top">public func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1DatagramSocketClient.html#afc3da28ec94b12365a60e0a8e0273409">open</a> (IPSocketAddress: IPSocketAddress)</td></tr>
<tr class="memdesc:afc3da28ec94b12365a60e0a8e0273409 inherit pub_methods_classcommonsNet_1_1DatagramSocketClient"><td class="mdescLeft">&#160;</td><td class="mdescRight">在指定端口的本地主机上的指定地址处打开 DatagramSocket  <br /></td></tr>
<tr class="separator:afc3da28ec94b12365a60e0a8e0273409 inherit pub_methods_classcommonsNet_1_1DatagramSocketClient"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a07f62c0c51a3d53142f08bc13d447ca0 inherit pub_methods_classcommonsNet_1_1DatagramSocketClient"><td class="memItemLeft" align="right" valign="top">public func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1DatagramSocketClient.html#a07f62c0c51a3d53142f08bc13d447ca0">setDatagramSocketFactory</a> (factory: ?<a class="el" href="interfacecommonsNet_1_1DatagramSocketFactory.html">DatagramSocketFactory</a>)</td></tr>
<tr class="memdesc:a07f62c0c51a3d53142f08bc13d447ca0 inherit pub_methods_classcommonsNet_1_1DatagramSocketClient"><td class="mdescLeft">&#160;</td><td class="mdescRight">设置DatagramSocketClient使用的DatagramSocketFactory来打开DatagramSockets  <br /></td></tr>
<tr class="separator:a07f62c0c51a3d53142f08bc13d447ca0 inherit pub_methods_classcommonsNet_1_1DatagramSocketClient"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2986e7ad450928ce89e35b38ec539fd8 inherit pub_methods_classcommonsNet_1_1DatagramSocketClient"><td class="memItemLeft" align="right" valign="top">public func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1DatagramSocketClient.html#a2986e7ad450928ce89e35b38ec539fd8">setDefaultTimeout</a> (timeout: Duration)</td></tr>
<tr class="memdesc:a2986e7ad450928ce89e35b38ec539fd8 inherit pub_methods_classcommonsNet_1_1DatagramSocketClient"><td class="mdescLeft">&#160;</td><td class="mdescRight">设置打开套接字时使用的默认超时  <br /></td></tr>
<tr class="separator:a2986e7ad450928ce89e35b38ec539fd8 inherit pub_methods_classcommonsNet_1_1DatagramSocketClient"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa7c800ada59a901f353dab58758525d6 inherit pub_methods_classcommonsNet_1_1DatagramSocketClient"><td class="memItemLeft" align="right" valign="top">public func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1DatagramSocketClient.html#aa7c800ada59a901f353dab58758525d6">setDefaultTimeout</a> (timeout: Int64)</td></tr>
<tr class="memdesc:aa7c800ada59a901f353dab58758525d6 inherit pub_methods_classcommonsNet_1_1DatagramSocketClient"><td class="mdescLeft">&#160;</td><td class="mdescRight">设置打开套接字时使用的默认超时  <br /></td></tr>
<tr class="separator:aa7c800ada59a901f353dab58758525d6 inherit pub_methods_classcommonsNet_1_1DatagramSocketClient"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-attribs" name="pub-attribs"></a>
Public 属性</h2></td></tr>
<tr class="memitem:af55dfb738162706296606b49569e2442"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1echo_1_1EchoUDPClient.html#af55dfb738162706296606b49569e2442">static let ECHO_DEFAULT_PORT</a> : UInt16 = 7;</td></tr>
<tr class="memdesc:af55dfb738162706296606b49569e2442"><td class="mdescLeft">&#160;</td><td class="mdescRight">默认的 echo 协议端口，根据 RFC 862 设置为 7。  <br /></td></tr>
<tr class="separator:af55dfb738162706296606b49569e2442"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_attribs_classcommonsNet_1_1discard_1_1DiscardUDPClient"><td colspan="2" onclick="javascript:toggleInherit('pub_attribs_classcommonsNet_1_1discard_1_1DiscardUDPClient')"><img src="closed.png" alt="-"/>&#160;Public 属性 继承自 <a class="el" href="classcommonsNet_1_1discard_1_1DiscardUDPClient.html">commonsNet.discard.DiscardUDPClient</a></td></tr>
<tr class="memitem:a5142142162104c90b20fe4edaa43c19e inherit pub_attribs_classcommonsNet_1_1discard_1_1DiscardUDPClient"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1discard_1_1DiscardUDPClient.html#a5142142162104c90b20fe4edaa43c19e">static let DISCARD_DEFAULT_PORT</a> : UInt16 = 9;</td></tr>
<tr class="memdesc:a5142142162104c90b20fe4edaa43c19e inherit pub_attribs_classcommonsNet_1_1discard_1_1DiscardUDPClient"><td class="mdescLeft">&#160;</td><td class="mdescRight">默认的丢弃协议端口，根据 RFC 863 设置为 9。  <br /></td></tr>
<tr class="separator:a5142142162104c90b20fe4edaa43c19e inherit pub_attribs_classcommonsNet_1_1discard_1_1DiscardUDPClient"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pri-attribs" name="pri-attribs"></a>
Private 属性</h2></td></tr>
<tr class="memitem:ac97c2d5c86f39a8353b881ce4c96991c"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1echo_1_1EchoUDPClient.html#ac97c2d5c86f39a8353b881ce4c96991c">var receivedata</a> : Array&lt;Byte&gt; = []</td></tr>
<tr class="memdesc:ac97c2d5c86f39a8353b881ce4c96991c"><td class="mdescLeft">&#160;</td><td class="mdescRight">放置接收数据的数组。  <br /></td></tr>
<tr class="separator:ac97c2d5c86f39a8353b881ce4c96991c"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="inherited" name="inherited"></a>
额外继承的成员函数</h2></td></tr>
<tr class="inherit_header pro_methods_classcommonsNet_1_1DatagramSocketClient"><td colspan="2" onclick="javascript:toggleInherit('pro_methods_classcommonsNet_1_1DatagramSocketClient')"><img src="closed.png" alt="-"/>&#160;Protected 成员函数 继承自 <a class="el" href="classcommonsNet_1_1DatagramSocketClient.html">commonsNet.DatagramSocketClient</a></td></tr>
<tr class="memitem:a7060e4aa1d53b57b837bfc280eaa9daf inherit pro_methods_classcommonsNet_1_1DatagramSocketClient"><td class="memItemLeft" align="right" valign="top">protected func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1DatagramSocketClient.html#a7060e4aa1d53b57b837bfc280eaa9daf">checkOpen</a> (): UdpSocket</td></tr>
<tr class="memdesc:a7060e4aa1d53b57b837bfc280eaa9daf inherit pro_methods_classcommonsNet_1_1DatagramSocketClient"><td class="mdescLeft">&#160;</td><td class="mdescRight">得到非空的UdpSocket或者抛出异常  <br /></td></tr>
<tr class="separator:a7060e4aa1d53b57b837bfc280eaa9daf inherit pro_methods_classcommonsNet_1_1DatagramSocketClient"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pro_attribs_classcommonsNet_1_1DatagramSocketClient"><td colspan="2" onclick="javascript:toggleInherit('pro_attribs_classcommonsNet_1_1DatagramSocketClient')"><img src="closed.png" alt="-"/>&#160;Protected 属性 继承自 <a class="el" href="classcommonsNet_1_1DatagramSocketClient.html">commonsNet.DatagramSocketClient</a></td></tr>
<tr class="memitem:ac1d6e58d6682ffe35a5d1ddd767f747b inherit pro_attribs_classcommonsNet_1_1DatagramSocketClient"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1DatagramSocketClient.html#ac1d6e58d6682ffe35a5d1ddd767f747b">var _timeout_</a> : Int64</td></tr>
<tr class="memdesc:ac1d6e58d6682ffe35a5d1ddd767f747b inherit pro_attribs_classcommonsNet_1_1DatagramSocketClient"><td class="mdescLeft">&#160;</td><td class="mdescRight">默认超时  <br /></td></tr>
<tr class="separator:ac1d6e58d6682ffe35a5d1ddd767f747b inherit pro_attribs_classcommonsNet_1_1DatagramSocketClient"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae817188cccd266d039b791da4f839c4d inherit pro_attribs_classcommonsNet_1_1DatagramSocketClient"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1DatagramSocketClient.html#ae817188cccd266d039b791da4f839c4d">var _socket_</a> : ?UdpSocket</td></tr>
<tr class="memdesc:ae817188cccd266d039b791da4f839c4d inherit pro_attribs_classcommonsNet_1_1DatagramSocketClient"><td class="mdescLeft">&#160;</td><td class="mdescRight">用于连接的数据报套接字  <br /></td></tr>
<tr class="separator:ae817188cccd266d039b791da4f839c4d inherit pro_attribs_classcommonsNet_1_1DatagramSocketClient"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a81cba3257050238fc73f20aadceb4d69 inherit pro_attribs_classcommonsNet_1_1DatagramSocketClient"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1DatagramSocketClient.html#a81cba3257050238fc73f20aadceb4d69">var _isOpen_</a> : Bool</td></tr>
<tr class="memdesc:a81cba3257050238fc73f20aadceb4d69 inherit pro_attribs_classcommonsNet_1_1DatagramSocketClient"><td class="mdescLeft">&#160;</td><td class="mdescRight">客户端的套接字当前是否处于打开状态  <br /></td></tr>
<tr class="separator:a81cba3257050238fc73f20aadceb4d69 inherit pro_attribs_classcommonsNet_1_1DatagramSocketClient"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aae67ef3bfdd385af99f91c034e941bcc inherit pro_attribs_classcommonsNet_1_1DatagramSocketClient"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1DatagramSocketClient.html#aae67ef3bfdd385af99f91c034e941bcc">var _socketFactory_</a> : <a class="el" href="interfacecommonsNet_1_1DatagramSocketFactory.html">DatagramSocketFactory</a></td></tr>
<tr class="memdesc:aae67ef3bfdd385af99f91c034e941bcc inherit pro_attribs_classcommonsNet_1_1DatagramSocketClient"><td class="mdescLeft">&#160;</td><td class="mdescRight">数据报套接字的 DatagramSocketFactory  <br /></td></tr>
<tr class="separator:aae67ef3bfdd385af99f91c034e941bcc inherit pro_attribs_classcommonsNet_1_1DatagramSocketClient"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">详细描述</h2>
<div class="textblock"><p>EchoUDPClient 类是实现了 RFC 862 中描述的 Echo 协议的 UDP 客户端。 </p>
<p>要使用此类，只需打开本地的 UDP 端口（使用 open() 方法）， 然后调用 <code><a class="el" href="">echosend()</a></code> 方法向服务器发送数据，接着调用 <code><a class="el" href="">receive()</a></code> 方法接收回显数据。 在完成回显数据操作后，请调用 close() 进行适当的清理。</p>
<dl class="section see"><dt>参见</dt><dd>EchoTCPClient </dd>
<dd>
DiscardUDPClient </dd></dl>
</div><h2 class="groupheader">成员函数说明</h2>
<a id="a0f81c305c2b1bbf0eace72548b1df334" name="a0f81c305c2b1bbf0eace72548b1df334"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0f81c305c2b1bbf0eace72548b1df334">&#9670;&#160;</a></span>echosend() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">public func commonsNet.echo.EchoUDPClient.echosend </td>
          <td>(</td>
          <td class="paramname"><em>data</em>:&#160;</td>
          <td class="paramtype">Array&lt;Byte&gt;, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramname"><em>host</em>:&#160;</td>
          <td class="paramtype">String&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td>: Unit </td>
        </tr>
      </table>
</div><div class="memdoc">

<p>与 send(data, data.length, host) 相同。 </p>

</div>
</div>
<a id="a9ca41f3b665d12f63c94d7ef960a94f7" name="a9ca41f3b665d12f63c94d7ef960a94f7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9ca41f3b665d12f63c94d7ef960a94f7">&#9670;&#160;</a></span>echosend() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">public func commonsNet.echo.EchoUDPClient.echosend </td>
          <td>(</td>
          <td class="paramname"><em>data</em>:&#160;</td>
          <td class="paramtype">Array&lt;Byte&gt;, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramname"><em>length</em>:&#160;</td>
          <td class="paramtype">Int64, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramname"><em>host</em>:&#160;</td>
          <td class="paramtype">String&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td>: Unit </td>
        </tr>
      </table>
</div><div class="memdoc">

<p>将指定的数据发送到指定服务器的默认 echo 端口。 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">data</td><td>要发送的 echo 数据 </td></tr>
    <tr><td class="paramname">length</td><td>要发送的数据长度，应小于或等于数据字节数组的长度。 </td></tr>
    <tr><td class="paramname">host</td><td>服务器的地址 </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a70f445f7c6b3a623e03ebd61aaaf6b89" name="a70f445f7c6b3a623e03ebd61aaaf6b89"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a70f445f7c6b3a623e03ebd61aaaf6b89">&#9670;&#160;</a></span>getreceivedata()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">public func commonsNet.echo.EchoUDPClient.getreceivedata </td>
          <td>(</td>
          <td class="paramtype"></td><td>)</td>
          <td>: Array&lt;UInt8&gt; </td>
        </tr>
      </table>
</div><div class="memdoc">

<p>获取接收到的数据。 </p>
<dl class="section return"><dt>返回</dt><dd>缓存的接收到的数据 </dd></dl>

</div>
</div>
<a id="a45cd29f0b30fb5ad15bce2b2442958bc" name="a45cd29f0b30fb5ad15bce2b2442958bc"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a45cd29f0b30fb5ad15bce2b2442958bc">&#9670;&#160;</a></span>receive() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">public func commonsNet.echo.EchoUDPClient.receive </td>
          <td>(</td>
          <td class="paramname"><em>data</em>:&#160;</td>
          <td class="paramtype">Array&lt;Byte&gt;</td><td>)</td>
          <td>: Int64 </td>
        </tr>
      </table>
</div><div class="memdoc">

<p>与 receive(data, data.length) 相同。 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">data</td><td>接收输入的缓冲区 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>接收到的字节数 </dd></dl>

</div>
</div>
<a id="ac0739c978df8216acc6c4b6f782dfab0" name="ac0739c978df8216acc6c4b6f782dfab0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac0739c978df8216acc6c4b6f782dfab0">&#9670;&#160;</a></span>receive() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">public func commonsNet.echo.EchoUDPClient.receive </td>
          <td>(</td>
          <td class="paramname"><em>data</em>:&#160;</td>
          <td class="paramtype">Array&lt;Byte&gt;, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramname"><em>length</em>:&#160;</td>
          <td class="paramtype">Int64&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td>: Int64 </td>
        </tr>
      </table>
</div><div class="memdoc">

<p>接收回显数据并返回其长度。 </p>
<p>数据可能分散在多个数据报中，可能需要多次调用 receive 方法。此外，UDP 数据包不一定按发送顺序到达。</p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">data</td><td>接收输入的缓冲区 </td></tr>
    <tr><td class="paramname">length</td><td>缓冲区的长度 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>实际接收到的数据长度 </dd></dl>

</div>
</div>
<h2 class="groupheader">类成员变量说明</h2>
<a id="af55dfb738162706296606b49569e2442" name="af55dfb738162706296606b49569e2442"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af55dfb738162706296606b49569e2442">&#9670;&#160;</a></span>static let ECHO_DEFAULT_PORT</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">commonsNet.echo.EchoUDPClient.static let ECHO_DEFAULT_PORT : UInt16 = 7;</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>默认的 echo 协议端口，根据 RFC 862 设置为 7。 </p>

</div>
</div>
<a id="ac97c2d5c86f39a8353b881ce4c96991c" name="ac97c2d5c86f39a8353b881ce4c96991c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac97c2d5c86f39a8353b881ce4c96991c">&#9670;&#160;</a></span>var receivedata</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">commonsNet.echo.EchoUDPClient.var receivedata : Array&lt;Byte&gt; = []</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>放置接收数据的数组。 </p>

</div>
</div>
<hr/>该类的文档由以下文件生成:<ul>
<li>src/echo/<a class="el" href="echo__udp__client_8cj.html">echo_udp_client.cj</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- HTML footer for doxygen 1.9.6-->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="namespacecommonsNet.html">commonsNet</a></li><li class="navelem"><a class="el" href="namespacecommonsNet_1_1echo.html">echo</a></li><li class="navelem"><a class="el" href="classcommonsNet_1_1echo_1_1EchoUDPClient.html">EchoUDPClient</a></li>
    <li class="footer">制作者 <img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.6 </li>
  </ul>
</div>
</body>
</html>
